Repository navigation
feat(hosts): OAR deep fusion Phase 2 — harden OAR host and migrate DSH, Claude/ACP, and bounded Codex - #9861
Conversation
…and doctor readiness Signed-off-by: song <xinxinsong66@gmail.com>
Signed-off-by: song <xinxinsong66@gmail.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4268baa84f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ost.version Signed-off-by: song <xinxinsong66@gmail.com>
…dex exec Signed-off-by: song <xinxinsong66@gmail.com>
…ting Signed-off-by: song <xinxinsong66@gmail.com>
…olated shell Signed-off-by: song <xinxinsong66@gmail.com>
…l_worker Signed-off-by: song <xinxinsong66@gmail.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
评审提交 2d96b4c8336e44bdd467fd4a7b421a877fcf74f7,对照基线 1541c290edef4733666bb15da4f80491be1e8bea,并检查与当时主干 d3346487352b96e6e492f5db83f651f0eeb85285 的组合。使用已配置 ACP Agent 的 Chat 用户需要确认原来选定的模型和推理档位,也需要区分失败和完整答案。 Phase 1 的 ACP stdio 入口读取会话选项、应用选择,再由现有 Chat 读回确认后放行。 从正常 ACP 启动入口打开一个用户已选择模型与推理档位的会话。 正常传输已输出部分文本,但 OAR 返回结构化失败终态。 OAR 把执行迁到新的会话宿主。ACP 启动仍传入原来请求的选项,但未把实际配置填回适配器。收到失败状态时也照常发布最终答案。 本次在当前堆叠提交、本地协议进程和 OAR 响应边界验证。保留 Chat 原有模型读回规则与权限边界。
改动思路 / Approach
本次分支在 Phase 1 上迁移 ACP、DSH、Claude 与部分 Codex 入口,并将 OAR 设为默认。 OAR Runtime 提供会话和运行事实。现有 Chat 适配器负责将模型确认和终态交给共享读回与发布代码。 由真实 OAR 会话事实提供已确认配置与可发现选项,再交给现有确认逻辑。无法读回时保留该能力的直接路径或呈现明确不可用。 进入最终答案发布前检查结构化 outcome,按既有 Chat 错误路径保留失败和可恢复性。 现有调用方继续使用原状态与返回路径,故障由实际入口返回,评审以状态与外部可见结果核对具体分支。
具体改动 / Changes
- MODEL-CONFIRMATION 原模型选择能读回并送达。
- OUTCOME-READBACK 宿主失败不写成成功。
真实 stdio 选定模型和档位能够通过原有观察校验。相同请求经迁移适配器返回空模型与档位,Chat 拒绝发送。两种传输终态都发出一次 answer.final。OAR 脚本宿主的现有流式和清理用例通过。
- 把启动结果构造为 Chat 适配器。 _start_via_oar
- 解释流式结果并发布答案。 _start_turn_via_oar
- 在发送前验证实际模型和档位。 observed_model_settings
- 保留宿主的运行观察与终态。 serializePromptRun
- 相邻已迁移路径区分失败终态。 DshChatAdapter
对主干的风险 / Risks
48 项 Python 定向测试、控制平面类型检查、外部传输 lint 与快速预合并的阻断项通过。快速预合并保留一条未涉及改动文件的维护性告警。 选定模型复测比较了真实 stdio 协议子进程与 OAR open 响应替身。独立的本地 ACP 进程接 OAR 尝试在启动时超时,未归因。没有实测真实账户、跨宿主迁移或所有默认入口。 当前堆叠与所查 main 存在实际文本冲突。当前结论仅覆盖各自声明的基线与候选。
- [P1] 已配置的 ACP 会话在发送之前被拒绝。 从正常 ACP 启动入口打开一个用户已选择模型与推理档位的会话。 迁移路径传递了请求值,但构造适配器时未填任何已确认配置,现有 observed_model_settings 收到空模型与空档位,返回 unsupported_configuration。保留的直接 stdio 对照能确认同一选择。 由真实 OAR 会话事实提供已确认配置与可发现选项,再交给现有确认逻辑。无法读回时保留该能力的直接路径或呈现明确不可用。 覆盖受支持模型和档位、回复缺失以及不同于请求的返回。 定位
- [P2] ACP 把失败的部分输出发布为最终答案。 正常传输已输出部分文本,但 OAR 返回结构化失败终态。 同一文本在 completed 和 failed 对照均发布一次 answer.final,原失败状态未传给 Chat。 进入最终答案发布前检查结构化 outcome,按既有 Chat 错误路径保留失败和可恢复性。 对照同文本成功与失败,只有成功发布 answer.final。 定位
我的整体评价 / Verdict
请求修改。让已迁移适配器在真实入口上证明模型确认和失败终态,再重新评审。将未迁移或未验收的入口留在原路径可减少这一步的交付范围。 快速预合并与定向测试已核对,验收仍需覆盖完整调用方并读回失败状态。
English verdict: REQUEST_CHANGES at 2d96b4c. The promoted ACP path loses required model confirmation and publishes failed partial responses as final answers. Restore those behaviors before broad default activation.
Signed-off-by: song <xinxinsong66@gmail.com>
…under ratchet, and align machine credential tests Signed-off-by: song <xinxinsong66@gmail.com>
Signed-off-by: song <xinxinsong66@gmail.com>
… forwarding Signed-off-by: song <xinxinsong66@gmail.com>
…runtimes Signed-off-by: song <xinxinsong66@gmail.com>
…pdate supported host parity test Signed-off-by: song <xinxinsong66@gmail.com>
…n-phase4-storage-ui Signed-off-by: song <xinxinsong66@gmail.com>
…0 in Dashboard, and isolate PATH in runtime-readiness-live Signed-off-by: song <xinxinsong66@gmail.com>
…n-phase4-runtimes Signed-off-by: song <xinxinsong66@gmail.com>
…n-phase3 Signed-off-by: song <xinxinsong66@gmail.com>
…ion-phase2 Signed-off-by: song <xinxinsong66@gmail.com>
…eep-fusion-phase4-storage-ui Signed-off-by: song <xinxinsong66@gmail.com>
|
Updated Fixes Included
Verification & Gate Status
cc @loopx-agent @huangruiteng — ready for re-review after #9854. |
…n-phase4-runtimes Signed-off-by: song <xinxinsong66@gmail.com>
…n-phase3 Signed-off-by: song <xinxinsong66@gmail.com>
…ion-phase2 Signed-off-by: song <xinxinsong66@gmail.com>
…eep-fusion-phase4-storage-ui Signed-off-by: song <xinxinsong66@gmail.com>
…ase4-storage-ui feat(oar): sessions.sqlite WAL storage, in-process MCP write tools, and Dashboard OAR UI
…ase4-runtimes feat(oar): complete 16 OAR runtimes, CLI/Chat entrypoints, Workbench 0.142.0 alignment, and Windows Job containment
feat(oar): Phase 3 — native child streaming, unified OAR Goal Worker, and Codex Chat OAR decoupling
Summary
Stacked on #9854 (
codex/oar-deep-fusion-phase0-1), this PR delivers Phase 2 of the@botiverse/oar@0.142.0deep fusion:Complete, hardened OAR Session Host integration (
0e519e18):loopx/control_plane/oar/session_policy.ts): enforces LoopX sandbox/permission fences across all OAR runtimes — pinsDSH_PERMISSION_MODE(read-only/workspace-write, blocking OAR'sdanger-full-accessdefault) andsessionLogUpload: "off", injects Claude--permission-mode plan|acceptEdits+ read-onlydisallowedTools/--tools(blocking OAR's--dangerously-skip-permissionsdefault), and hardens CodexnativePermissions: "inherit"+sandbox_mode/approval_policy+ per-invocationwriteDirectoryfences.loopx/control_plane/oar/error_mapping.ts): maps OARFailureClass,failureAdvice, and typed session errors (SessionNotFoundError,SessionUnavailableError,ResumeCwdError,UnsupportedOptionError,RuntimeFailureError,ModelConfirmationError) directly onto LoopX'sHOST_FAILURE_KINDSand recovery semantics.session_hub.ts,session_host_server.ts,loopx/hosts/oar_client.py): addsoar.prompt_stream(coalescedtext_deltaframes over dedicated streaming sockets so concurrentabortnever blocks),redactRecordon stored raw records,reduceTaskState, runtime catalog/probing (list_runtimes,probe_all_runtimes,resolveOarRuntimeFromCommand), session controls (deliver,withdraw,abort,compact,stop_task,answer_question,sync_goal,session_telemetry,list_sessions), and dynamic authenticated loopbackserveMcpToolscallbacks (control_plane_mcp.ts).oar_runtime(collect_oar_runtime_readiness()) inloopx doctorJSON and Markdown output (loopx/doctor.py).oar_execution_engine_selected()toTruewith clean rollback viaLOOPX_EXECUTION_ENGINE=legacy.Phase 2 host migrations & legacy SDK/driver deletions (
4268baa8):deepseek-harness-sdkPython import andbuild_sdk_configinloopx/hosts/dsh/turn_host_adapter.pywith OARdshRuntimewhile preserving--dsh-runner,DshHostConfig,run_dsh_host, andDSH_HOST_CAPABILITIES.loopx/chat/dsh.py(DshChatAdapter) to persistent OARdshsessions with liveanswer.deltastreaming and nativeinterrupt_turn()->oar.abort()(keepingrunner=test seam).loopx/control_plane/turn_driver/oar_operation_host.py(loopback callback server + OARserveMcpTools), shrunkdsh_operation_host.pyfrom 416 LOC to a 66 LOC facade, and deletedloopx/control_plane/turn_driver/dsh_operation_connection.py+ 3 obsolete DSH SDK/AF_UNIX test suites (test_dsh_operation_connection.py,test_dsh_operation_entry.py,test_dsh_operation_sdk.py,-1,439 LOCdeleted outright;-964 LOCnet across the host migration commit).loopx/hosts/dsh/host_failure_map.py(281 -> 171 LOC) with anOarHostError.failure_kindfast path.ClaudeCodeAdapter(loopx/chat/providers.py) from rawclaude --print --output-format stream-jsonsubprocess parsing to persistentOarSessionHost(runtimeId="claude",permissionMode="read_only", live streaming, native abort).loopx/chat/acp.py(resolve_oar_acp_runtime) promoting 8 OAR built-in ACP runtimes (kimi,opencode,agy/antigravity,qwen,devin,codebuddy,qoder,factory/droid) ontoOarSessionHost, while keeping the compact ACP v1 stdio fallback forkiro-cli acpand custom/test ACP scripts._run_codex_via_oar,build_oar_codex_session_params) inloopx/control_plane/turn_driver/codex_cli.pywith admission watchdog ->oar.abort, nativeoutputSchema,writeDirectory,mcpServers,resume, and side-effect-free shim detection (_looks_like_python_shim, covering POSIX shebangs and Windowsdistliblaunchers) so legacy/fakecodex exectest fixtures cleanly take_run_codex_via_legacy_exec.loopx/control_plane/turn_driver/codex_operation_host.pytorun_oar_operation_host(..., host="codex-cli", runtime_id="codex").Scope Notes & Net LOC Ledger
0e519e18): 10 files,+1,908 / -354(adds full OAR policy/error/streaming/callback/doctor/test coverage).4268baa8): 19 files,+2,125 / -3,089(-964 LOCnet; deletes 4 obsolete DSH SDK/AF_UNIX driver & test files)._run_codex_via_legacy_exec(for_fake_codexshims andLOOPX_EXECUTION_ENGINE=legacyrollback), generic ACP v1 fallback (forkiro-cli acp/ custom scripts), reverse in-host plugins (packages/dsh-loopx-plugin/,loopx/claude_goal_mode/),antigravity-appdesktop LS,DirectModelAdapter, and--dsh-runner.Verification
npm run typecheck:control-plane+ stricttscontests/control_plane_ts/oar_session_hub.test.ts: 0 errorsnpm run test:control-plane: 6,940 passed, 0 failed, 5 skippedpytest tests/control_plane/test_operation_host_source_preflight.py: 36 passed (real OAR +serveMcpTools+ loopback operation callbacks overfile&sqlitestores)pytest tests/test_loopx_turn_codex_cli.py tests/control_plane/test_oar_phase2_hosts.py tests/control_plane/test_oar_session_client.py: 130 passedpytest tests/test_dsh_goal_mode.py tests/test_chat_dsh_adapter.py tests/test_chat_acp_startup_timeout.py tests/test_chat_agent.py(excluding local.venvoptionalmcppublic-reader cases): 902 passedpytest tests/test_chat_path_redaction.py: 68 passedpytest tests/hosts/test_host_harness_capabilities.py tests/test_codex_operation_host.py tests/test_chat_reasoning_selection.py: passedpytest tests/test_cli_dsh_launch.py tests/test_doctor_*.py tests/test_zcode_doctor_skill_delivery.py tests/capabilities/test_reliability_diagnostics_dsh_provider.py tests/test_dsh_context_page_reclamation.py tests/test_dsh_plugin_publish_workflow.py: 211 passedtest_stage2c_dependency_lock.py,test_top_level_module_budget.py,test_external_request_lint.py,test_repository_instruction_delivery.py,test_contributing_guide.py): passedruff check --select F,B,E7,E9&mypy --follow-imports=silenton all modified/new Phase 2 modules: 0 errorsloopx.contract.scan_public_boundaryacross all 25 changed/new files: 0 hits, 0 blocking hits, 0 warningsloopx canary premerge --tier quickchecks:git diff --check,check_rfc_bilingual.py,py_compile,semantic-vocabulary-drift-smoke.py,cli-output-budget-regression-smoke.pyall passed;control-plane-maintainability-ratchet-smoke.pyreports 0 findings on any file modified in this PR (only pre-existing untouchedloopx/status.py)examples/control_plane/oar-session-host-benchmark.py):0.162 ms/RPC,1.552 ms/warm turn,2.23 msabort-to-settled